from django.contrib.syndication.feeds import Feed
from simpleblog.dblog.models import Blog

class LatestEntries(Feed):
    title = "Latest blog entries"
    link = "/feeds/latest"
    description = "The most recent blog entries"
    
    def items(self):
      return Blog.objects.order_by('-post_date')[:3]
  
    def item_link(self, blog):
      return "/simpleblog/blog/%d/"%blog.id

